Repository navigation
Replace chosen-js with selectWoo & remove chosen-js from Arches - #13062
Conversation
chrabyrd
left a comment
There was a problem hiding this comment.
Overall looks good! just found a couple small things
| <div> | ||
| <select data-bind="chosen: {width: '100%'}, value: graphId, options: resources, optionsText: 'name', optionsValue: 'graphid', optionsCaption: {% quoted_trans _("Select a resource...") %}, optionsAfterRender: setResourceOptionDisable"></select> | ||
| <select data-bind=" | ||
| attr: {'data-label': {% quoted_trans _('Resource Model') %}}, |
There was a problem hiding this comment.
this announces the first option to screen readers instead of the placeholder. there's no value binding so the browser has the first option selected when SelectWoo builds the aria-label, and SelectWoo doesn't update it when select2Query clears the value. `
graphId` always starts null so on load this reads "Resource Model, Heritage Site" (or whatever's first) while "Select a resource..." is what's showing.
the ETL templates already handle this with value + valueAllowUnset, just needs the same here:
| attr: {'data-label': {% quoted_trans _('Resource Model') %}}, | |
| attr: {'data-label': {% quoted_trans _('Resource Model') %}}, | |
| value: graphId, | |
| valueAllowUnset: true, |
| <div class="col-xs-12 crm-selector"> | ||
| <select class="design" data-bind="attr: {'disabled': graphSettingsViewModel.nodeCount() > 1 }, value: graph.ontology_id, valueAllowUnset: true, options: ontologies, optionsText: 'name', optionsValue:'ontologyid', optionsCaption: {% quoted_trans _("No ontology") %}, chosen: {disable_search_threshold: 10, width: '500px'}"></select> | ||
| <select class="design" data-bind=" | ||
| attr: {'disabled': graphSettingsViewModel.nodeCount() > 1, 'data-label': {% quoted_trans _('Ontology') %}}, |
There was a problem hiding this comment.
same thing as resource.htm, a graph with no ontology reads "Ontology, CIDOC CRM" while showing "No ontology":
| attr: {'disabled': graphSettingsViewModel.nodeCount() > 1, 'data-label': {% quoted_trans _('Ontology') %}}, | |
| attr: {'disabled': graphSettingsViewModel.nodeCount() > 1, 'data-label': {% quoted_trans _('Ontology') %}}, | |
| value: graph.ontology_id, | |
| valueAllowUnset: true, |
| {% render_bundle 'bindings/chosen' %} | ||
| ``` | ||
|
|
||
| Also remove Chosen-js dependencies: |
There was a problem hiding this comment.
this one 500s the landing page if it's left in, not just a 404. bindings/chosen isn't in webpack-stats anymore so render_bundle raises WebpackBundleLookupError. might be worth calling out since every project generated from the template has it
phudson-he
left a comment
There was a problem hiding this comment.
Apart from what @chrabyrd found, I've not found any other issues
chiatt
left a comment
There was a problem hiding this comment.
This looks good. Just a couple of minor changes would be really nice.
- The nodegroup-selector.htm is no longer used. All four related files can be deleted. I realize it's a bit out of scope of this PR, but since you mention it in the description, could you go ahead and remove them?
arches/app/media/js/views/components/nodegroup-selector.js
arches/app/templates/views/components/nodegroup-selector.htm
arches/app/media/js/views/components/functions/local-file-storage.js
arches/app/templates/views/components/functions/local-file-storage.htm
- I don't see the new scrollbars. That issue might be isolated to Windows machines. I do see the wide width of the dropdowns in the map widget. Could you fix those? It seems pretty simple and it would be nice not to introduce that regression.
Files removed in 2c966ef.
Thanks for the spot on the map widget dropdowns - though the only one I see that's different is the Coordinate Reference dropdown (applied in 5103e8e)? Are there others @chiatt ? As for the new scrollbars, see examples below: map-widget-scrollbar.mp4card-type-scrollbar.mp4It only affects dropdowns which are within 600px of the right side of the screen (due to this select2 css) - anything left or central is unaffected. In 7604610 I updated the css to ensure the inner select container box is given the |
7604610 to
ea8b4ba
Compare
Types of changes
Description of Change
As discussed in the issue below, chosen-js is unmaintained and inaccessible, so should be removed from Arches and where used should be replaced with selectWoo.
Issues Solved
Forms part of #13043 (doesn't close)
Also closes #9051 (as this was identified whilst testing and easily fixed)
Checklist
Accessibility Checklist
Developer Guide
Accessibility has now improved, since chosen was not accessible.
Ticket Background
Further comments
Chosen was used across 34 templates. The dropdowns and those files were as follows. Each was tested with any additional actions noted: